The present invention relates generally to the field of signal processing. More particularly, the present invention relates to signal segmentation.
In the field of signal processing, signal segmentation is used to separate one portion of a signal (e.g., subject data) from another (e.g., background data). Preferably, signal segmentation occurs automatically based on a known characteristic about the signal.
For example, in industrial automation, video cameras are used to capture digital images of manufactured products, such as, fabricated parts, welds, etc. The digital images are used to assess the quality of the manufactured product. Using the example of a weld, a video camera automatically takes digital images of a series of welds on a product, segments each weld from its respective background, and either displays it to a human operator or makes a quality determination based on preprogrammed desirable or undesirable characteristics of the weld.
However, existing methods for segmenting subject data from background data are lacking. According to one method, a histogram is generated representing the frequency of the gray scale values of the pixels of the image. A bimodal frequency distribution is presupposed, with a large mode representing the background and another, generally smaller, mode representing the image. A threshold is drawn between the large mode and the smaller mode of the histogram. Pixels on one side of the threshold are attributed to the background and pixels on the other side of the threshold are attributed to the image.
One drawback of this method is that often the image includes pixels that are both darker and lighter than the background. This is particularly true in an industrial setting where the background becomes dirty from manufacturing processes and/or the lighting provided to the background fluctuates. Therefore, more than two modes occur in the histogram, and the selected threshold frequently mis-allocates important data points.
Accordingly, what is needed is an improved method and apparatus for signal segmentation. The method and apparatus would more accurately separate a subject from the background. The method and apparatus would further accurately separate a subject from a background when the object is both lighter and darker than the background, and when the background includes a structured surface, dirt, shadows, etc. In addition, the method would be capable of handling images having great variations in overall brightness by compensating for the overall brightness. Further still, the method and apparatus would be applicable to other signals, such as one-dimensional and three-dimensional signals, to segment a portion of interest from the background signal.
According to one exemplary embodiment, a method of separating subject data from background data in a signal data set includes generating a frequency distribution of the subject data and background data based on a characteristic; identifying a maximum of the frequency distribution; establishing a first threshold to one side of the maximum; establishing a second threshold to another side of the maximum; and assigning data outside the first and second thresholds as one of the subject data and the background data.
According to an alternative embodiment, an apparatus for segmenting subject data from background data in an image data set is disclosed. The apparatus includes a video camera and a signal processing circuit. The video camera is configured to acquire the image data set. The signal processing circuit is coupled to the video camera and is configured to receive the image data set, generating a frequency distribution of the subject data and the background data based on a characteristic, identify a maximum point of the frequency distribution, establish a first threshold point to one side of the maximum point, establish a second threshold point to another side of the maximum point, and assign data points outside the first and second threshold points as one of the subject data and the background data.
According to yet another exemplary embodiment, a method of separating subject data from background data in a signal data set is disclosed. The method includes providing a background data set free of subject data; subtracting the background data set from the signal data set to generate resulting data and generating a frequency distribution of the resulting data; identifying a maximum of the frequency distribution; establishing a threshold to one side of the maximum of the signal data set; and assigning data points on one side of the threshold as one of the subject data and the background data.
According to still another exemplary embodiment, a system for separating subject data from background data in a single data set is disclosed. The system includes a means for generating a frequency distribution of the subject data and background data based on a characteristic; a means for identifying a maximum of the frequency distribution; a means for establishing a first threshold to one side of the maximum point; a means for establishing a second threshold to another side of the maximum point; and a means for assigning data between the first and second thresholds as one of the subject data and the background data.